package com.akaovi.rectangle;

/**
 * @author akaovi
 * @version 1.0
 * @description
 * @date 2022/10/17 14:03
 * @since 2022/10/17 14:03
 */
public class Rectangle {
    private Double width = 1.0;
    private Double height = 1.0;

    public Rectangle() {
    }

    public Rectangle(Double width, Double height) {
        this.width = width;
        this.height = height;
    }

    public Double getWidth() {
        return width;
    }

    public void setWidth(Double width) {
        this.width = width;
    }

    public Double getHeight() {
        return height;
    }

    public void setHeight(Double height) {
        this.height = height;
    }

    public double getArea() {
        return width * height;
    }

    public double getPerimeter() {
        return 2 * (width + height);
    }

    @Override
    public String toString() {
        return "Rectangle{" +
                "width=" + width +
                ", height=" + height +
                '}';
    }
}
